package com.ibeeking.found.upms.cp.rest.service;

import com.ibeeking.found.common.entity.LoginCpUserDTO;
import com.ibeeking.found.upms.api.common.query.LoginAuthQuery;
import com.ibeeking.found.upms.service.common.param.CpUserRegisterParam;
import com.ibeeking.found.upms.service.common.query.LogoutAuthQuery;
import com.ibeeking.found.upms.service.common.query.CpUserRegisterQuery;
import com.ibeeking.found.upms.service.common.query.CpOauth2Query;
import com.ibeeking.found.upms.service.common.vo.CpUserRegisterVO;

import com.ibeeking.found.upms.service.common.vo.UrlVO;

/**
 * @ClassName IMemberInfoService
 * @Description 登录企业小程序接口
 * @Author ibeeking
 * @Date 2021-01-21 13:52
 **/
public interface ILoginService {
    /**
     * 通过手机号查询是否注册
     *
     * @param mobile
     * @return
     */
    CpUserRegisterVO checkMobile(String mobile);

    /**
     * 查询是否注册
     *
     * @param query
     * @return
     */
    UrlVO buildPreAuthUrl(CpOauth2Query query);

    /**
     * 查询用户
     * @param query
     * @return
     */
    LoginCpUserDTO queryLoginCpUser(LoginAuthQuery query, String tenantId);
    /**
     * 查询是否注册
     *
     * @param query
     * @return
     */
    CpUserRegisterVO loginByAuthorize(CpUserRegisterQuery query);
    /**
     * 通过手机号查询是否注册
     *
     * @param query
     * @return
     */
    CpUserRegisterVO loginByMobile(CpUserRegisterQuery query);

    /**
     * 会员注册
     *
     * @param param
     * @return
     */
    CpUserRegisterVO registerNewUser(CpUserRegisterParam param);

    /**
     * 员工退出企微端注册
     * @param query
     * @return
     */
    Boolean logout(Long employeeId, LogoutAuthQuery query);

    LoginCpUserDTO queryUserByOpenId(String openId, String tenantId);

    LoginCpUserDTO queryUserByMobileAndOpenId(LoginAuthQuery query, String tenantId);

    LoginCpUserDTO queryUserById(Long id, String tenantId);

}
